package com.cxh.service.impl;

import com.cxh.base.DataServiceImpl;
import com.cxh.dao.SysUserDao;
import com.cxh.entity.SysUser;
import com.cxh.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 类说明：用户
 *
 * @author ChenXH
 * @date 2018年7月22日
 */
@Service("sysUserService")
public class SysUserServiceImpl extends DataServiceImpl<SysUser> implements SysUserService {
    @Autowired
    private SysUserDao dao;

    @Override
    public SysUser loadUser(String loginName) {
        return dao.loadUser(loginName);
    }

    @Override
    public List<SysUser> loadPageList(Map<String, Object> map) {
        return dao.loadPageList(map);
    }

    @Override
    public List<SysUser> loadAll(Integer docId) {
        // TODO Auto-generated method stub
        return dao.loadAll(docId);
    }

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public void addUser(SysUser sysUser) {
        dao.insert(sysUser);
    }

}
